package com.ad_hccm.dao.GeneralInformation;

import com.ad_hccm.domain.GeneralInformation.InducingFactors;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 诱发或加重因素Dao
 */
@Mapper
public interface InducingFactorsDao {
     @Insert("insert into inducing_factors value(#{id}, #{fatigue}, #{diet}, #{infect}, #{menstruation}, #{medicine}, #{season}, #{traumaSurgery}, #{spirit}, #{other})")
     public boolean save(InducingFactors inducingFactors);

     @Update("update inducing_factors set fatigue = #{fatigue}, diet = #{diet}, infect = #{infect}, menstruation = #{menstruation}, medicine = #{medicine}, season = #{season}, traumaSurgery = #{traumaSurgery}, spirit = #{spirit}, other = #{other} where id = #{id}")
     public boolean update(InducingFactors inducingFactors);

     @Select("select * from inducing_factors where id=#{id}")
     public InducingFactors getById(String id);

     @Select("select * from inducing_factors")
     public List<InducingFactors> getAll();
}